<?php
/**
 * 用户状态
 * 
 * @package ews
 * @ews Enterprise WorkShop
 * @version 1.0 alpha
 * @since 2011-05-04
 * @author monkee
 */

class doingModel extends model
{
	public function update($user_id, $message){
		$id = DB::insert('doing', array(
			'user_id' => $user_id,
			'mktime' => TIMESTAMP,
			'message' => $message
		));
		if($id>0)
			DB::update('user', array('doing' => $message), "user_id = {$user_id}");
		return $id;
	}
	public function get($doing_id){
		return DB::fetchOne('SELECT * FROM '.DB::table('doing')." WHERE doing_id = {$doing_id}");
	}
}
?>